<template>
  <div class="pages-wrap">
    <!-- 当前的分类页面 -->
    <div class="page">
      <app-header></app-header>
      <form action="/">
  <van-search
    v-model="value"
    show-action
    placeholder="请输入搜索关键词"
    @search="onSearch"
    @cancel="onCancel"
    shape="round"
  />
</form>
<button @click="test">123</button>

<!-- <v-for="item in chatlist" :key="index">123</v-for> -->

    </div>
    <!-- 下一级页面 -->
    <transition enter-active-class="slideIn" leave-active-class="slideOut">
      <router-view></router-view>
    </transition>
  </div>
</template>

<script>
import { Toast,Search } from 'vant'; 
import { mapState } from 'vuex'

export default {
  name: "chat-page",
  components: {
    [Search.name]: Search,
  },
  data(){
    return{
      value:""
    }

  },
  methods: {
     onSearch(val) {
      Toast(val);
    },
    onCancel() {
      Toast('取消');
    },
    test(){
      this.$router.push("/chat/chat-item")
    // this.$store.dispatch('chat/requestData')
    // console.log(this.chatlist);


    }
  },
  computed:{
    ...mapState("chat", ["isLoad",'chatlist']),
  },
  mouted(){
  }

}
</script>

<style lang="scss" scoped>
@function vw($px){
  @return ($px/375) * 100vw;
}
.page{
  padding-top: vw(60);
}

</style>